<template>
 <div style="margin: 20px;">
<el-container>
    <el-header class="func">学生信息修改</el-header>
    <el-main>
<el-form label-width="80px"  class="form">
  <el-form-item label="学号">
    <el-input type="text" v-model="Addfrom_student.sno"></el-input>
  </el-form-item>
  <el-form-item label="姓名">
    <el-input type="text" v-model="Addfrom_student.sname"></el-input>
  </el-form-item>
  <el-form-item label="年龄">
    <el-input type="text"  v-model="Addfrom_student.sage"></el-input>
  </el-form-item>
  <el-form-item label="性别">
    <el-input type="text"  v-model="Addfrom_student.ssex"></el-input>
  </el-form-item>
  <el-form-item label="年级">
    <el-input type="text"  v-model="Addfrom_student.sdept"></el-input>
  </el-form-item>
  <el-form-item label="学制">
    <el-input type="text"  v-model="Addfrom_student.sedu_sys"></el-input>
  </el-form-item>
  <el-form-item label="民族">
    <el-input type="text"  v-model="Addfrom_student.snation"></el-input>
  </el-form-item>
  <el-form-item label="生源地">
    <el-input type="text"  v-model="Addfrom_student.region"></el-input>
  </el-form-item>
  <el-form-item label="政治面貌">
    <el-input type="text"  v-model="Addfrom_student.spolitics"></el-input>
  </el-form-item>
   <el-form-item >
<el-button class="func" type="primary" @click="submit_student">修改个人简历</el-button>
</el-form-item>
<el-form-item label="学号">
    <el-input type="text" v-model="Addfrom_punishment.sno"></el-input>
  </el-form-item>
  <el-form-item label="惩罚内容">
    <el-input type="text"  v-model="Addfrom_punishment.pname"></el-input>
  </el-form-item>
  <el-form-item label="惩罚日期">
    <el-input type="text"  v-model="Addfrom_punishment.date"></el-input>
  </el-form-item>
   <el-form-item >
<el-button class="func" type="primary" @click="submit_punishment">修改惩罚记录</el-button>
</el-form-item>
<el-form-item label="学号">
    <el-input type="text" v-model="Addfrom_honor.sno"></el-input>
  </el-form-item>
  <el-form-item label="奖励内容">
    <el-input type="text"  v-model="Addfrom_honor.hname"></el-input>
  </el-form-item>
  <el-form-item label="奖励日期">
    <el-input type="text" v-model="Addfrom_honor.date"></el-input>
  </el-form-item>
   <el-form-item >
<el-button class="func" type="primary" @click="submit_honor">修改奖励记录</el-button>
</el-form-item>
<el-form-item label="学号">
    <el-input type="text" v-model="Addfrom_sc.sno"></el-input>
  </el-form-item>
  <el-form-item label="课程号">
    <el-input type="text" v-model="Addfrom_sc.cno"></el-input>
  </el-form-item>
  <el-form-item label="课程成绩">
    <el-input type="text" v-model="Addfrom_sc.grade"></el-input>
  </el-form-item>
    <el-form-item >
<el-button class="func" type="primary" @click="submit_sc">修改课程成绩</el-button>
</el-form-item>
</el-form>
</el-main>
</el-container>
</div>
</template>


<script>
import { ElMessage } from "element-plus";
export default {
    data() {
    return {
        Addfrom_student :{
         sno : "",
         sname : "",
         sage : "",
         ssex : "",
         sdept : "",
         sedu_sys : "",
         sregion : "",
         spolitics : "",
         snation : "",
         },
         Addfrom_punishment:{
           sno :"",
           pname :"",
           date :""
         },
         Addfrom_honor:{
           sno :"",
           hname :"",
           date :""
         },
         Addfrom_sc:{
           sno :"",
           cno :"",
           grade :""
         },

      }
    },
    methods:{
      async submit_student(){
      const {
        data:res
      } = await this.$http.put("/system/apis/student",this.Addfrom_student);
      console.log(res);
      if(res.code==20000)
      {
        ElMessage.success({
            message: '更新成功',
            type: 'success'
          });
      }else{
        ElMessage.warning({
            message: '更新失败',
            type: 'warning'
          });
      }
    },
    async submit_punishment(){
      const {
        data:res
      } = await this.$http.put("/system/apis/punishment",this.Addfrom_punishment);
      console.log(res);
      if(res.code==20000)
      {
        ElMessage.success({
            message: '更新成功',
            type: 'success'
          });
      }else{
        ElMessage.warning({
            message: '更新失败',
            type: 'warning'
          });
      }
    },
    async submit_honor(){
      const {
        data:res
      } = await this.$http.put("/system/apis/honor",this.Addfrom_honor);
      console.log(res);
      if(res.code==20000)
      {
        ElMessage.success({
            message: '更新成功',
            type: 'success'
          });
      }else{
        ElMessage.warning({
            message: '更新失败',
            type: 'warning'
          });
      }
    },
    async submit_sc(){
      const {
        data:res
      } = await this.$http.put("/system/apis/sc",this.Addfrom_sc);
      console.log(res);
      if(res.code==20000)
      {
        ElMessage.success({
            message: '更新成功',
            type: 'success'
          });
      }else{
        ElMessage.warning({
            message: '更新失败',
            type: 'warning'
          });
      }
    },
  }
}
  
</script>